home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11120 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: newsfeed.internetmci.com!panix!usenet
  2. From: gugu@panix.com (Dae Choi)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Does gcc support template?
  5. Date: 12 Mar 1996 19:37:54 GMT
  6. Organization: PANIX Public Access Internet and Unix, NYC
  7. Message-ID: <1869.6645T885T1536@panix.com>
  8. References: <3145CC6F.4821@babbage.cs.qc.edu>
  9. NNTP-Posting-Host: gugu.dialup.access.net
  10. X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
  11.  
  12. Hi Chris,
  13.  
  14. >Dae Choi wrote:
  15. >>
  16. >> Hi everyone.  I've been desperately trying to compile the following
  17. >> program to test template but the compiler would give error messages:
  18.  
  19. >  ...
  20.  
  21. >> 106 % g++ temp_avg.cc
  22. >> ld: Undefined symbol
  23. >>    _average_value__FPfi
  24. >>    _average_value__FPii
  25. >>    collect2: ld returned 2 exit status
  26. >> 107 %
  27. >>
  28. >> -----------------------------------------------------------------------
  29. >>
  30. >> What does this mean?  How can I fix this problem?
  31. >>
  32. >       It's a problem with your g++ installation.  I copied your
  33. >       code into a file on my Solaris 2.3 machine running g++
  34. >       2.7.2 and got this:
  35.  
  36. >vickery@babbage[work]> g++ temp_avg.cc
  37. >vickery@babbage[work]> a.out
  38. >Average of integer value is 3
  39. >Average of floating value is 3.3
  40. >vickery@babbage[work]> g++ -v
  41. > gcc -v
  42. >Reading specs from /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.3/2.7.2/specs
  43. >gcc version 2.7.2
  44.  
  45.  
  46. I tried on two different different machines:
  47.  
  48. 54 % g++ temp_avg.cc
  49. ld: Undefined symbol
  50.    _average_value__FPfi
  51.    _average_value__FPii
  52.    collect2: ld returned 2 exit status
  53.  
  54. 55 % g++ -v
  55.  gcc -v
  56.  Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/2.5.8/specs
  57.  gcc version 2.5.8
  58. 56 %
  59. ---------------------------------------------------------------------------
  60. 50 % g++ temp_avg.cc Undefined                       first referenced
  61.  symbol                             in file
  62.  average_value__FPfi                 /usr/tmp/cca003UE1.o
  63.  average_value__FPii                 /usr/tmp/cca003UE1.o
  64.  ld: fatal: Symbol referencing errors. No output written to a.out
  65. 51 % g++ -v
  66.  /opt/gnu/bin/gcc -v
  67.  Reading specs from /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/specs
  68.  gcc version 2.5.8
  69. 52 %
  70.  
  71.  
  72. Could it be that gcc version 2.5.8 doesn't support template?  But it's a
  73. relief to know that the code works on some machines... ;^)
  74.  
  75. Thanks,
  76.  
  77. Dae Choi
  78. gugu@panix.com
  79.  
  80.